/* xbidmi.h */

#ifndef XBI_DMI
#define XBI_DMI 1

#include <xbi/xbicommon.h>

/*
  The Disk Manufacturing Information, (abbreviated as DMI), is a sector on a DVD that stores miscelaneous informations
 about the disc (mastering date, media identifier, etc...)
*/

#define _XBIDMIMediaIDLength 16

typedef struct _XBIDiskManufacturingInformation XBIDiskManufacturingInformation;

// Creation - Copy - Deletion
XBIDiskManufacturingInformation * XBIDMICreateFromBuffer(byte_t * buffer, int size, XBIError * error);
XBIDiskManufacturingInformation * XBIDMICreateFromFile(FILE * file, XBIError * error);
XBIDiskManufacturingInformation * XBIDMICopy(XBIDiskManufacturingInformation * dmi);
void XBIDMIDelete(XBIDiskManufacturingInformation * dmi);

// Data manipulation
uint32_t XBIDMIGetCRC32(XBIDiskManufacturingInformation * dmi);

// Accessors
time_t XBIDMIGetMasteringDate(XBIDiskManufacturingInformation * dmi);
byte_t * XBIDMIGetMediaID(XBIDiskManufacturingInformation * dmi);
byte_t * XBIDMIGetData(XBIDiskManufacturingInformation * dmi);
size_t XBIDMIGetSize(XBIDiskManufacturingInformation * dmi);

#endif
